<admintpl file="header" />
<!-- Bootstrap -->



<link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />

<style type="text/css">
    .table td {
        border: 1px solid #ddd !important;
    }
</style>
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('ConstructionWeeklyReport/index')}">周工作计划管理</a></li>
            <if condition="($level eq '0' OR $level eq '1')">
            	<li ><a href="{:U('ConstructionWeeklyReport/plan_add')}">新增工作计划</a></li>
            </if>
            <li><a href="{:U('ConstructionWeeklyReport/complete_add')}">新增完成情况</a></li>
            <li class="active"><a href="{:U('ConstructionWeeklyReport/plan_view')}">查看工作计划</a></li>
        </ul>
        <section class="tab-pane active fade in" id="access">

            <div class="row">
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="panel panel-info">

                        <div class="panel-body">
                            <form class="js-ajax-form form-horizontal form-inline tg">
                                <div class="header text-center">
                                    <h2>下周工作计划安排</h2>
                                    <hr />
                                </div>
                                <input type="hidden" ></input>
                                <div class="form-group">
                                    <label for="exampleInputName2">开始时间</label>
                                    <input type="text" name="being_date" class="js-date input-xt input-name" value="{$data.being_date}" readonly/>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail2">结束时间</label>
                                    <input type="text" name="end_date" class="js-date input-xt input-name" value="{$data.end_date}" readonly/>
                                </div>


                                <table class="table table-bordered table-condensed">
                                    <thead>
                                        <tr>
                                            <th colspan="2">日期</th>
                                            <th>主要工作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="odd-color">
                                            <td rowspan="2" class="td-center">
                                                <h3 class="text-success">周一</h3>
                                            </td>
                                            <td class="td-center ">上午</td>
                                            <td>
                                                <textarea class="input planarea" name="monday_am" readonly>{$data.monday_am}</textarea>
                                            </td>
                                        </tr>
                                        <tr class="odd-color">

                                            <td class="td-center">下午</td>
                                            <td><textarea class="input planarea" name="monday_pm" readonly>{$data.monday_pm}</textarea></td>
                                        </tr>
                                        <tr>
                                            <td rowspan="2" class="td-center">
                                                <h3 class="text-success">周二</h3>
                                            </td>
                                            <td class="td-center">上午</td>
                                            <td><textarea class="input planarea" name="tuesday_am" readonly>{$data.tuesday_am}</textarea></td>
                                        </tr>
                                        <tr>

                                            <td class="td-center">下午</td>
                                            <td><textarea class="input planarea" name="tuesday_pm" readonly>{$data.tuesday_pm}</textarea></td>
                                        </tr>
                                        <tr class="odd-color">
                                            <td rowspan="2" class="td-center">
                                                <h3 class="text-success">周三</h3>
                                            </td>
                                            <td class="td-center">上午</td>
                                            <td><textarea class="input planarea" name="wednesday_am" readonly>{$data.wednesday_am}</textarea></td>
                                        </tr>
                                        <tr class="odd-color">

                                            <td class="td-center">下午</td>
                                            <td><textarea class="input planarea" name="wednesday_pm" readonly>{$data.wednesday_pm}</textarea></td>
                                        </tr>
                                        <tr>
                                            <td rowspan="2" class="td-center">
                                                <h3 class="text-success">周四</h3>
                                            </td>
                                            <td class="td-center">上午</td>
                                            <td><textarea class="input planarea" name="thursday_am" readonly>{$data.thursday_am}</textarea></td>
                                        </tr>
                                        <tr>

                                            <td class="td-center">下午</td>
                                            <td><textarea class="input planarea" name="thursday_pm" readonly>{$data.thursday_pm}</textarea></td>
                                        </tr>
                                        <tr>
                                            <td rowspan="2" class="td-center">
                                                <h3 class="text-success">周五</h3>
                                            </td>
                                            <td class="td-center">上午</td>
                                            <td><textarea class="input planarea" name="friday_am" readonly>{$data.friday_am}</textarea></td>
                                        </tr>
                                        <tr>

                                            <td class="td-center">下午</td>
                                            <td><textarea class="input planarea" name="friday_am" readonly>{$data.friday_am}</textarea></td>
                                        </tr>
                                        <tr>
                                            <td rowspan="2" class="td-center text-danger">
                                                <h4>周六</h4>
                                            </td>
                                            <td class="td-center">上午</td>
                                            <td><textarea class="input planarea offday" name="saturday_am" readonly>{$data.saturday_am}</textarea></td>
                                        </tr>
                                        <tr>

                                            <td class="td-center">下午</td>
                                            <td><textarea class="input planarea offday" name="saturday_pm" readonly>{$data.saturday_pm}</textarea></td>
                                        </tr>
                                        <tr>
                                            <td rowspan="2" class="td-center text-danger">
                                                <h4>周日</h4>
                                            </td>
                                            <td class="td-center">上午</td>
                                            <td><textarea class="input planarea offday" name="sunday_am" readonly>{$data.sunday_am}</textarea></td>
                                        </tr>
                                        <tr>

                                            <td class="td-center">下午</td>
                                            <td><textarea class="input planarea offday" name="sunday_pm" readonly>{$data.sunday_pm}</textarea></td>
                                        </tr>
                                        <tr>

                                            <td class="td-center">备注</td>
                                            <td colspan="2"><textarea class="input planarea" name="remark" readonly>{$data.remark}</textarea></td>
                                            <input type="hidden" name="record_type" value="1" />
                                        </tr>
                                    </tbody>
                                </table>
                                <a id="part" cwid="{$data.id}" style="font-size: 18px">导出到word</a>
                                <div class="form-actions">
                                    <a class="btn btn-default" href="{:U('ConstructionWeeklyReport/index')}">{:L('BACK')}</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function(){
        $("#part").bind("click",function(){
            var id=$("#part").attr("cwid");
            change_word("{:U('ConstructionWeeklyReport/in_word')}", $(this).attr("cwid"), $(this));
        });
    })
    
    function change_word(reqUrl, id, obj){
    $.ajax({
        url     : reqUrl, 
        type    : "post", 
        dataType : "json", 
        async   :false,
        data    : {"id":id, "AJAX": 1}, 
        success : function(data){
            if(data.rtnPath){

                var url="/index.php?g=Admin&m=News&a=download&filePath="+encodeURI(data.rtnPath)+"&fileName="+encodeURI(data.rtnName);
                window.open(url);
            } 
        },
        error   : function(){
            alert("下载word失败");
        }
    });
 }
</script>
 